<?php
    require ('../smarty/Smarty.class.php');

    $smarty = new Smarty();

    //Smarty “自编口诀-五配置两方法”
    //五配置介绍
    $smarty -> left_delimiter = "{"; //左定界符
    $smarty -> right_delimiter = "}"; //右定界符
    $smarty -> template_dir = "tpl"; //html模板的地址
    $smarty -> compile_dir  = "template_c"; //模板编译生成的文件
    $smarty -> cache_dir = "cache"; //缓存

    //以下是开启缓存的另外两个配置/因为通常不用Smarty的缓存机制，所以此项为了解
    /*$smarty -> caching = true; //开启缓存
    $smarty -> cache_lifetime = 120;*/

    $time = time();
    $smarty->assign('time',$time);

    $str = 'abcdefg';
    $smarty->assign('str', $str);


    /*
     function smarty_test($params){
        /*print_r($params);
        $p1 = $params['p1'];
        $p2 = $params['p2'];
        $name = $params['name'];

        return '传入的参数1值为：'.$p1.',传入的参数2值为:'.$p2 .'新加的'.$name;
    }
    */
    //registerPlugin函数  registerPlugitestn() — 注册插件方法
    /*$smarty->registerPlugin('function', 'smarty_test', 'smarty_test');*/




    /*
     * $smarty->display('smarty_test.tpl');
     */
    $smarty->display('area.tpl');

